package qiurank;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * Created by Administrator on 2016/1/8.
 */
public class PaFactory {
    public static Class<?> pa=null;
    public static Constructor<?> _class=null;
    public static Object createPa(UrlObject urlObject,UrlManageInterface urlManage){
        try {
            if (PaFactory.pa == null) {
                PaFactory.pa = Class.forName("app." + Config.getValue("package") + "." + Config.getValue("package") + "Pa");
                PaFactory._class=pa.getConstructors()[0];
                return PaFactory._class.newInstance(urlObject, urlManage);
            } else {
                return PaFactory._class.newInstance(urlObject, urlManage);
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
